using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Marlimer.Common;

namespace Marlimer.Data.Universal
{
    public class uni_TipoMovimiento
    {
        public DataTable getDTTipoMovimiento(int flg_tipmov)
        {
            SqlCommand sqlcmd = new SqlCommand();
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet ds = new DataSet();

            sqlcmd.CommandText = "spsdtTipoMovimiento";
            sqlcmd.CommandType = CommandType.StoredProcedure;
            sqlcmd.Connection = Session.getConexion();

            sqlcmd.Parameters.Add("@flg_tipmov", SqlDbType.Int);
            sqlcmd.Parameters["@flg_tipmov"].Value = flg_tipmov;  

            da.SelectCommand = sqlcmd;
            da.Fill(ds);
            return ds.Tables[0];
        }

        public DataTable getTipoMovimientoByCod(int ccod_tipmov)
        {
            SqlCommand sqlcmd = new SqlCommand();
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet ds = new DataSet();

            sqlcmd.CommandText = "spsTipoMovimientoByCod";
            sqlcmd.CommandType = CommandType.StoredProcedure;
            sqlcmd.Connection = Session.getConexion();

            sqlcmd.Parameters.Add("@ccod_tipmov", SqlDbType.Int);
            sqlcmd.Parameters["@ccod_tipmov"].Value = ccod_tipmov;

            da.SelectCommand = sqlcmd;
            da.Fill(ds);
            return ds.Tables[0];
        }
    }
}
